/*
 * Copyright (c) 2018 maoyan.com
 * All rights reserved.
 *
 */
package com.darren.archive.repository;

import com.darren.archive.entity.SysRoleFunction;
import com.darren.framework.repository.GenericRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * 系统角色操作持久层
 *
 * @author darren
 * @created 2019/12/07
 */
public interface SysRoleFunctionRepository extends GenericRepository<SysRoleFunction, Long> {

    void deleteByRoleId(long roleId);

    @Query(value = " select roleId  from SysRoleFunction where roleId = :roleId and  checkedStatus = :checkedStatus  ")
    List<Long> findFunctionIdsByRoleIdAndCheckedStatus(@Param("roleId") Long roleId, @Param("checkedStatus") Integer checkedStatus);


    @Query(value = " select roleId  from SysRoleFunction where roleId = :roleId and  checkedStatus = :checkedStatus  ")
    List<Long> findByRoleId(@Param("roleId") Long roleId, @Param("checkedStatus") Integer checkedStatus);


}

